// import { Menu } from '@/routes/Menu';
// import { Goods } from '@/routes/Goods';
// import { Role } from '@/routes/Role';
const path = require('path');
const fs = require('fs');
// 获取routes/下面的所有ts文件
const files = fs.readdirSync(path.resolve(__dirname, './routes'));
const Routes = files
  .filter((file) => file.endsWith('.ts')) // 只处理 .ts 文件
  .flatMap((file) => {
    const filePath = path.resolve(__dirname, './routes', file);
    const route = require(filePath);
    return Object.values(route).flat(); // 获取 route 对象的所有值并扁平化
  });

export { Routes };
